package vn.kiemviec.app.utils;

import android.util.Log;

/**
 * 
 * @author TrungTT
 * @Date	27-Feb-2013
 * @Description	Use for monitor log in application.When release product change value of TURN_OFF = true,
 * 				we dont show log in product for security
 */
public class LogTools {

	public static boolean TURN_OFF = false;
	public static String DEFAULT_TAG = "TrungTT";
	public static long trackTime;
	
	public static void debug(String msg){
		if(TURN_OFF) return;
		Log.d(DEFAULT_TAG,msg);
	}
	
	public static void info(String msg){
		if(TURN_OFF) return;
		Log.i(DEFAULT_TAG,msg);
	}
	
	public static void error(String msg){
		if(TURN_OFF) return;
		Log.e(DEFAULT_TAG,msg);
	}
	
	public static void startTrackTime(){
		trackTime = System.currentTimeMillis();
	}
	
	public static void showTrackTime(String msg){
		if(TURN_OFF) return;
		long time = System.currentTimeMillis();
		long period = time - trackTime;
		
		Log.e(DEFAULT_TAG,msg+" time :"+period+"ms");
	
	}
}
